<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>央票通</title>
	<link rel="stylesheet" href="./resource/css/index.css">
	<link rel="stylesheet" href="./resource/css/user_name.css">
</head>
<body>
<!-- 头部 -->
@include('common.index_head')
<!-- 个人中心 -->
<div class="cont-user">
	<div class="user-name">
		<div class="main">
			<div class="name-cont name-two">
				<div class="title">
					<span>验证码</span>
				</div>
				<div class="form">
					<form action="/user_bankcard_bound" method="post" onsubmit="return check_null()">
						<div class="form-group form-code">
							<label for=""><span>*</span>短信验证码</label>
							<input type="text" class="form-control" placeholder="请输入短信验证码" name="verify" id="verify">
							<input type="hidden" value="{{$info->bank_id}}" name="bank_id" id="bank_id">
							<input type="hidden" value="{{$info->bank_num}}" name="bank_num" id="bank_num">
							<input type="hidden" value="{{$info->bank_name}}" name="bank_name" id="bank_name">
							<input type="hidden" value="{{$info->bound_mobile}}" name="bound_mobile" id="bound_mobile">
							<input type="hidden" value="{{$info->kaihuhang}}" name="kaihuhang" id="kaihuhang">
							<input type="hidden" value="{{$info->bound_name}}" name="bound_name" id="bound_name">
							<input type="hidden" value="{{$info->province}}" name="province" id="province">
							<input type="hidden" value="{{$info->city}}" name="city" id="city">
							<input type="hidden" value="{{$info->area}}" name="area" id="area">
							<input type="hidden" value="{{$info->bank_code}}" name="bank_code" id="bank_code">
							<input type="hidden" value="{{$info->id_card}}" name="id_card" id="id_card">
							<input type="hidden" value="{{$info->token}}" name="token" id="token">
							<input type="hidden" value="v_id" name="v_id">
							<span class="code" id="f_captcha">没收到？重新获取</span>
							{{--<span class="code">--}}
								{{--没收到？重新获取--}}
							{{--</span>--}}
						</div>
						<button type="submit" class="btn btn-register">确定</button>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- footer -->
@include('common.index_foot')
<script src="./resource/js/jquery-1.11.3.min.js"></script>
<script src="./resource/js/index.js"></script>
{{--<script src="./resource/js/user_code.js"></script>--}}
<script src="./resource/js/user.js"></script>
<script src="./resource/js/province_city.js"></script>
<script src="./resource/jquery/banaddnk.js"></script>
<script>
	function check_null(){
		var verify = document.getElementById('verify').value;
		if(!verify){
			Showbo.Msg.nameauth("验证码不能为空",function(btn){
			})
			return false;
		}
	}

	$('#f_captcha').bind('click',function foo() {
		var  bank_id            =$("#bank_id").val();
		var  bank_num           =$("#bank_num").val();
		var  bound_name         =$("#bound_name").val();
		var  bank_name          =$("#bank_name").html();
		var  kaihuhang          =$("#kaihuhang").val();//
		var  bound_mobile       =$("#bound_mobile").val();//手机号
		var  province           =$("#province").val();
		var  city               =$("#city").val();
		var  area               =$("#area").val();
		var  id_card            =$("#id_card").val();
		var  bank_code          =$("#bank_code").val();
		var  token              =$("#token").val();
		var  v_id               =$("#v_id").val();

		if(1){
			var wait = 60;
			var int = function fetch_captcha() {
				if (wait == 0) {
					$("#f_captcha").bind("click", foo);
					$('#f_captcha').html('没收到？重新获取');
					clearInterval(a)
					wait = 60;
				}
				else {
					$('#f_captcha').unbind("click", foo);
					$('#f_captcha').html("重新发送(" + wait + ")");
					wait--;
				}
			}
			var a = setInterval(int, 1000);
			$.ajax({
				url: "/get_bank_code",
				type: "POST",
				data : {bank_code:bank_code,id_card:id_card,bank_num:bank_num,bank_name:bank_name,kaihuhang:kaihuhang,bound_mobile:bound_mobile,bound_name:bound_name,province:province,city:city,area:area,bank_id:bank_id,token:token,v_id:v_id},
				success: function (msg) {
					if(msg==1){
						alert('验证码发送成功');
					}else{
						alert(msg);
					}
				}
			});
		}
	})


</script>

</body>
</html>